<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>首页</title>
    <link type="text/css" rel="stylesheet" href="/Public/Home/css/reset.css">
    <link type="text/css" rel="stylesheet" href="/Public/Home/css/main.css">
<style>
    .dropdown{
        display: inline-block;
        position: relative;
    }
    .dropdown-content{
        display: none;
        position: absolute;
        background-color: #f9f9f9;
       color: #000;
        padding: 12px 16px;

    }
    .dropdown:hover .dropdown-content{
        display: block;
    }

</style>
</head>
<body>
<div class="headerBar">
    <div class="topBar">
        <div class="comWidth">
            <div class="rightArea">
                欢迎来到电子商城！
              <?php if(empty($_SESSION['uname'])): ?><a href="<?php echo U('User/login');?>">[登录]</a><a href="<?php echo U('reg');?>">[免费注册]</a>
                 <?php else: ?>
                <span>欢迎您,</span>
                  <div class="dropdown">
                      <a href="#"><?php echo (session('uname')); ?> </a>
                          <div class="dropdown-content">
                              <a href="/index.php/Home/Index/myOrder/id/<?php echo (session('uid')); ?>">我的订单</a>
                              <a href="/index.php/Home/Index/changePwd/uname/<?php echo (session('uname')); ?>">修改密码</a>
                          </div>
                  </div>
                  <a href="<?php echo U('User/logout');?>">[退出]</a><?php endif; ?>
            </div>
        </div>
    </div>
    <div class="logoBar">
        <div class="comWidth">

            <div class="search_box fl">
                <input type="text" class="search_text fl" id="content">
                <input type="button" value="搜 索" class="search_btn fr" onclick="search()">
            </div>
            <div class="shopCar fr">
                <span class="shopText fl">购物车</span>
                <span class="shopNum fl">0</span>
            </div>
        </div>
    </div>
    <div class="navBox">
        <div class="comWidth clearfix">
            <div class="shopClass fl">
                <h3>全部商品分类<i class="shopClass_icon"></i></h3>
                <div class="shopClass_show">
                    <dl class="shopClass_item">
                        <dt><a href="#" class="b">手机</a> <a href="#" class="b">数码</a> <a href="#" class="aLink">合约机</a></dt>
                        <dd><a href="#">荣耀3X</a> <a href="#">单反</a> <a href="#">智能设备</a></dd>
                    </dl>
                    <dl class="shopClass_item">
                        <dt><a href="#" class="b">手机</a> <a href="#" class="b">数码</a> <a href="#" class="aLink">合约机</a></dt>
                        <dd><a href="#">荣耀3X</a> <a href="#">单反</a> <a href="#">智能设备</a></dd>
                    </dl>
                    <dl class="shopClass_item">
                        <dt><a href="#" class="b">手机</a> <a href="#" class="b">数码</a> <a href="#" class="aLink">合约机</a></dt>
                        <dd><a href="#">荣耀3X</a> <a href="#">单反</a> <a href="#">智能设备</a></dd>
                    </dl>
                    <dl class="shopClass_item">
                        <dt><a href="#" class="b">手机</a> <a href="#" class="b">数码</a> <a href="#" class="aLink">合约机</a></dt>
                        <dd><a href="#">荣耀3X</a> <a href="#">单反</a> <a href="#">智能设备</a></dd>
                    </dl>
                    <dl class="shopClass_item">
                        <dt><a href="#" class="b">手机</a> <a href="#" class="b">数码</a> <a href="#" class="aLink">合约机</a></dt>
                        <dd><a href="#">荣耀3X</a> <a href="#">单反</a> <a href="#">智能设备</a></dd>
                    </dl>
                </div>
            </div>
            <ul class="nav fl">
                <li><a href="#" class="active">数码城</a></li>

                <li><a href="#">团购</a></li>
                <li><a href="#">发现</a></li>
                <li><a href="#">二手特卖</a></li>
                <li><a href="#">名品会</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="banner comWidth clearfix">
    <div class="banner_bar banner_big ">

            <a href="#"><img id="img1"src="/Public/Home/image/1.jpg" alt="banner"></a>

    </div>
</div>

<?php if(is_array($cate)): foreach($cate as $key=>$for): if(!empty($for["goods"])): ?><div class="shopTit comWidth">
    <span class="icon"></span><h3><?php echo ($for["cname"]); ?></h3>
    <a href="/index.php/Home/Index/more/id/<?php echo ($for["id"]); ?>" class="more">更多&gt;&gt;</a>
</div>
<div class="shopList comWidth clearfix">
    <div class="leftArea">
        <div class="banner_bar banner_sm">
            <ul class="imgBox">
                <li><a href="#"><img src="/Public/Home/image/banner_sm_01.jpg" alt="banner"></a></li>
                <li><a href="#"><img src="/Public/Home/image/banner_sm_02.jpg" alt="banner"></a></li>
            </ul>
        </div>
    </div>


    <div class="rightArea">
        <div class="shopList_top clearfix">

           <?php if(is_array($for['goods'])): $i = 0; $__LIST__ = $for['goods'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$d): $mod = ($i % 2 );++$i; if($d["is_show"] == 1): ?><div class="shop_item">
                <div class="shop_img">
                    <a href="/index.php/Home/Index/proDetails/cname/<?php echo ($for["cname"]); ?>/id/<?php echo ($d["id"]); ?>" target="_blank"><img height="200" width="187" src="<?php echo ($d["gimg"]); ?>" alt=""></a>
                </div>
                <h6><?php echo (filter($d["gname"],0,30)); ?></h6>
                <p>￥<?php echo ($d["gscj"]); ?></p>
            </div><?php endif; endforeach; endif; else: echo "" ;endif; ?>
        </div>

        <div class="shopList_sm clearfix">
            <?php if(is_array($for['two'])): $i = 0; $__LIST__ = $for['two'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$s): $mod = ($i % 2 );++$i; if($d["is_show"] == 1): ?><div class="shopItem_sm">
                <div class="shopItem_smImg">
                    <a href="/index.php/Home/Index/proDetails/cname/<?php echo ($for["cname"]); ?>/id/<?php echo ($s["id"]); ?>" target="_blank"><img width="95" height="95" src="<?php echo ($s["gimg"]); ?>" alt=""></a>
                </div>
                <div class="shopItem_text">
                    <h6><?php echo (filter($s["gname"],0,30)); ?></h6>
                    <p>￥<?php echo ($s["gscj"]); ?></p>
                </div>
            </div><?php endif; endforeach; endif; else: echo "" ;endif; ?>
        </div>
    </div>
</div><?php endif; endforeach; endif; ?>

<div class="hr_25"></div>
<div class="footer">
    <p><a href="#">商城简介</a><i>|</i><a href="#">商城公告</a><i>|</i> <a href="#">招纳贤士</a><i>|</i><a href="#">联系我们</a><i>|</i>客服热线：400-675-1234</p>
    <p>Copyright &copy; 2006 - 2018 版权所有&nbsp;&nbsp;&nbsp;渝ICP备09037834号&nbsp;&nbsp;&nbsp;渝ICP证B1034-8373号&nbsp;&nbsp;&nbsp;某市公安局XX分局备案编号：123456789123</p>
    <p class="web"><a href="#"><img src="/Public/Home/image/webLogo.jpg" alt="logo"></a><a href="#"><img src="/Public/Home/image/webLogo.jpg" alt="logo"></a><a href="#"><img src="/Public/Home/image/webLogo.jpg" alt="logo"></a><a href="#"><img src="/Public/Home/image/webLogo.jpg" alt="logo"></a></p>
</div>
<script>
    // 当窗口被加载时就触发一个函数
    window.onload = function() {
        // 设置定时
        window.setInterval("changeImg()", 5000);
    }
    var i = 1;
    function changeImg(){
        i++;
        // 获得图片的控制权
        if(i > 4){
            i=1;
        }
        var img1 = document.getElementById("img1");
        img1.src="/Public/Home/image/" + i + ".jpg";
    }
    function search() {
        var content=document.getElementById('content').value;

    }
</script>
</body>
</html>